import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
    plugins: [vue()],
    server: {
        host: '0.0.0.0',
        port: 5173,
        open: true,
        proxy: {
            '/api': {
                target: 'http://172.16.222.7:9005', // 开发环境
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '')
            }
        },
    },
    resolve: {
        alias: {
            "@": path.resolve(__dirname, './src')
        }
    }
})
